(function(angular){
	//创建模块
	var app = angular.module('pdcApp',[]);
	//过滤器
	app.filter('trustHtml', function ($sce) {
    return function (input) {
        return $sce.trustAsHtml(input);
    }
});
	//创建控制器
	app.controller('pdcCtrl',["$scope","$http",function($scope,$http){
		productid = location.search;
		$scope.productname = decodeURI(productid.split("&")[1].slice(9));
//		console.log($scope.productname);
		//头部信息
		$http({
			mothed:"GET",
			url:"http://139.199.192.48:9090/api/getproduct"+productid
		}).then(function(data){
			$scope.data = data.data.result[0];
//			console.log($scope.data);
		});
		//获取评论
		$http({
			mothed:"GET",
			url:"http://139.199.192.48:9090/api/getproductcom"+productid
		}).then(function(edata){
			$scope.edata = edata.data.result;
//			console.log($scope.edata);
		});
	}]);
})(angular)